﻿<Window x:Class="DiagnosticsT.DbCommandVisualizerWindow" x:ClassModifier="Friend"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="{x:Static r:Resources.DbCommandVisualizer}" Height="350" Width="525" 
    xmlns:r="clr-namespace:Tools.My.Resources" Icon="/Tools.VisualStudio.Debugger;component/Images/db.png">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0">
            <Label Content="{x:Static r:Resources.DataType}"/>
            <TextBlock Text="{Binding CommandTypeName, Mode=OneWay}"/>
            <Label Content="{x:Static r:Resources.CommandType}"/>
            <TextBlock Text="{Binding CommandType, Mode=OneWay}"/>
        </StackPanel>
        <Label Content="{x:Static r:Resources.CommandText}" Grid.Row="1"/>
        <TextBox Grid.Row="2" MaxLines="10" Text="{Binding CommandText, Mode=OneWay}"/>
        <Label Content="{x:Static r:Resources.Parameters}" Grid.Row="3"/>
        <DataGrid ItemsSource="{Binding Parameters, Mode=OneWay}" Grid.Row="4" AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding ParameterName, Mode=OneWay}" Header="Name" IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding DbType, Mode=OneWay}" Header="Type"  IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding Value, Mode=OneWay}" Header="Value"  IsReadOnly="True"/>
                <DataGridCheckBoxColumn Binding="{Binding IsNullable, Mode=OneWay}" Header="Nullable"  IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding Direction, Mode=OneWay}" Header="Direction"  IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding Precision, Mode=OneWay}" Header="Precision"  IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding Size, Mode=OneWay}" Header="Size"  IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding SourceColumn, Mode=OneWay}" Header="SourceColumn"  IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding SourceVersion, Mode=OneWay}" Header="SourceVersion"  IsReadOnly="True"/>
                <DataGridTextColumn Binding="{Binding DataType, Mode=OneWay}" Header="{x:Static r:Resources.DataType}"  IsReadOnly="True"/>
            </DataGrid.Columns>
        </DataGrid>
        <TextBlock Grid.Row="5">
            <TextBlock Text="{x:Static r:Resources.DbCommandVisualizerInfo}"/>
            <Hyperlink NavigateUri="http://tools.codeplex.com">Tools.CodePlex.com</Hyperlink>
        </TextBlock>
    </Grid>
</Window>
